package br.fmapn.process.entities;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
/**
 * Entity class representing a UserBusinessOperation 
 * @author Fellipe
 */
@Entity
public class UserBusinessOperation implements Serializable {
	private static final long serialVersionUID = 4460917473570789901L;
	private int id;
	private Date date;
	private String session;
	private BusinessOperation businessOperation;
	private User user;
	
	public UserBusinessOperation() {
		super();
	}
	
	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public String getSession() {
		return session;
	}
	public void setSession(String session) {
		this.session = session;
	}
	
	@ManyToOne
	public BusinessOperation getBusinessOperation() {
		return businessOperation;
	}
	public void setBusinessOperation(BusinessOperation businessOperation) {
		this.businessOperation = businessOperation;
	}
	
	@ManyToOne(fetch= FetchType.EAGER)
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
}
